home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / pctj8506.arc / MACHINE.ASM < prev    next >
Assembly Source File  |  1986-01-18  |  3KB  |  61 lines

  1.  
  2.  
  3.  
  4. ; Machine Identification 
  5.  
  6. id_base equ     0f000h                  ;segment for machine id 
  7. id_off  equ     0fffeh                  ;offset for machine id 
  8. pc_id   equ     0ffh                    ;id for IBM PC 
  9. xt_id   equ     0feh                    ;id for XT and Portable 
  10. jr_id   equ     0fdh                    ;id for PCjr 
  11. at_id   equ     0fch                    ;id for PC AT 
  12.  
  13. code    segment public 
  14.  
  15. assume cs:code,ds:code 
  16.  
  17.         org     100h                    ;set up as a COM file 
  18. start:  jmp     begin 
  19.  
  20. pc_msg  db      'System is an IBM PC','$' 
  21. xt_msg  db      'System is an IBM PC XT or Portable PC','$' 
  22. jr_msg  db      'System is an IBM PCjr','$' 
  23. at_msg  db      'System is an IBM PC AT','$' 
  24. no_msg  db      'System is not an IBM computer','$' 
  25.  
  26. ; Check machine identification at location FOOO:FFFE 
  27.  
  28. begin:  mov     ax,cs                   ;set up ds 
  29.         mov     ds,ax                   ;  to same segment as cs 
  30.         mov     dx,id_base              ;move base of machine id 
  31.         mov     es,dx                   ;  into es 
  32.         mov     al,es:id_off            ;get machine id 
  33.         cmp     al,pc_id                ;is it an IBM PC? 
  34.         je      pc                      ;  yes 
  35.         cmp     al,xt_id                ;is it an XT / Portable? 
  36.         je      xt                      ;  yes 
  37.         cmp     al,jr_id                ;is it a PCjr? 
  38.         je      jr                      ;  yes 
  39.         cmp     al,at_id                ;is it an AT? 
  40.         je      at                      ;  yes 
  41.         mov     dx,offset no_msg        ;print not an IBM msg 
  42.         jmp     print                   ; 
  43. pc:     mov     dx,offset pc_msg        ;print IBM PC msg 
  44.         jmp     print                   ; 
  45. xt:     mov     dx,offset xt_msg        ;print XT / Portable msg 
  46.         jmp     print                   ; 
  47. jr:     mov     dx,offset jr_msg        ;print PCjr msg 
  48.         jmp     print                   ; 
  49. at:     mov     dx,offset at_msg        ;print AT msg 
  50. print:  mov     ah,09h                  ;dos 9: print string
  51.         int     21h                     ;call dos function
  52.         mov     ah,4ch                  ;dos terminate program 
  53.         int     21h                     ;call dos function
  54. code    ends                            ; 
  55.         end     start                   ;start is entry point 
  56.  
  57.